  var serviceList = [{
      src: "images/fw1.jpg",
      text: "一键安装"
    },
    {
      src: "images/fw2.jpg",
      text: "一键退换"
    },
    {
      src: "images/fw3.jpg",
      text: "一键维修"
    },
    {
      src: "images/fw4.jpg",
      text: "服务进度"
    },
    {
      src: "images/fw5.jpg",
      text: "小米之家"
    },
    {
      src: "images/fw6.jpg",
      text: "客服中心"
    },
    {
      src: "images/fw7.jpg",
      text: "以旧换新"
    },
    {
      src: "images/fw8.jpg",
      text: "保障权益"
    },
  ]

  var service = document.querySelector("#service ul")
  // 动态渲染，并绑定点击事件
  serviceList.forEach((element) => {
    let li = document.createElement("li")
    li.innerHTML = `
  <img src="${element.src}" alt="">
  <p>${element.text}</p>
  `
    service.appendChild(li)
  });

  // 获取定位
  window.onload = function () {

    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function (position) {
        console.log(position.coords.latitude);
        console.log(position.coords.longitude);
      }, function (error) {
        console.log(error.message);
      });
    } else {
      console.log("浏览器不支持地理定位功能");
    }
  }